package tests

import (
	"context"
	"pulsar_study/application"
	"testing"
	"time"

	"github.com/stretchr/testify/suite"
)

type JsonlSenderSuite struct {
	suite.Suite
	JsonlCmdSrv *application.JsonlCmdSrv
}

func (j *JsonlSenderSuite) SetupSuite() {
	j.JsonlCmdSrv = injector.JsonlCmdSrv
}

func (j *JsonlSenderSuite) TestSend() {
	ctx := context.TODO()
	err := j.JsonlCmdSrv.SendMessages(ctx)
	j.NoError(err)
	ticker := time.NewTicker(10 * time.Minute)
	for {
		select {
		case <-ticker.C:
			return
		}
	}
}

func TestJsonlSenderSuite(t *testing.T) {
	suite.Run(t, new(JsonlSenderSuite))
}
